
let addZero = (val)=>{
    if(val < 10){
        return `0${val}`;
    }
    return val;
}

let getFullDate = (hasTime) =>{
    let now = new Date();
    if(!hasTime){
        return now.getFullYear()+'-'+ now.getMonth()+1 +'-'+ now.getDate();
    }else{
        return now.getFullYear()+'-'+ now.getMonth()+1 +'-'+addZero(now.getDate()) + ' ' + now.getHours() + ':' + now.getSeconds() + ':' + now.getMinutes();
    }
}
export default {
    getFullDate
   
}